home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17611 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: gaia.ns.utk.edu!mbk
  2. From: mbk@caffeine.engr.utk.edu (Matt Kennel)
  3. Newsgroups: comp.lang.java,comp.lang.c++
  4. Subject: Re: Will Java kill C++?
  5. Followup-To: comp.lang.java,comp.lang.c++
  6. Date: 16 Apr 1996 19:31:16 GMT
  7. Organization: University of Tennessee, Knoxville and Oak Ridge National Laboratory
  8. Message-ID: <4l0si4$pqd@gaia.ns.utk.edu>
  9. References: <4ksfdr$bhh@engnews2.Eng.Sun.COM> <3172DC7C.6B3F@sdt.com> <4ku4lk$lg6@engnews2.Eng.Sun.COM> <DpyH85.6uu@research.att.com>
  10. Reply-To: kennel@msr.epm.ornl.gov
  11. NNTP-Posting-Host: caffeine.engr.utk.edu
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. Andrew Koenig (ark@research.att.com) wrote:
  15. : In article <4ku4lk$lg6@engnews2.Eng.Sun.COM> linden@positive.Sun.COM (Peter van der Linden) writes:
  16.  
  17. : > >How would you have maintained C-style linkage and C++ typesafe
  18. : > >linkage in the same object module without changing the linker?
  19.  
  20. : > By writing a linker pre-pass program which checks for and enforces
  21. : > the type-safe linking rules.
  22.  
  23. : But such a program (a) would have to be rewritten for every machine
  24. : to which C++ was ported, and (b) would not solve the problem of what
  25. : name to give the linker for overloaded functions with the same name.
  26.  
  27. So?  
  28.  
  29. Eiffel and Ada and Sather compilers do it and their generics
  30. work like a swiss watch.
  31.  
  32. : For example, suppose one translation unit has
  33.  
  34. :     void f(int) { /* ... */ }
  35.  
  36. : and another has
  37.  
  38. :     void f(double) { /* ... */ }
  39.  
  40. : These two translation units are compiled separately.  When compiling C++
  41. : into C, what names should the compiler give to the C versions of these functions
  42. : so that your hypothetical prelinker will be able to tell them apart?
  43.  
  44. This shows that link semantics are language semantics (and are "remote
  45. object call" semantics), and it's only an accident of history that
  46. assembly, C and Fortran could all be satisfied by the same linking model. 
  47.  
  48. The real problem is that the Unix library API has only 'C' semantics so
  49. there is not sufficient motivation to leave this tarpit of anachronism.
  50.  
  51. The other anachronism is the insistence upon 'compiled separately'.
  52.  
  53. : -- 
  54. :                 --Andrew Koenig
  55. :                   ark@research.att.com
  56.